home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / misc / ini_library / sources / asm / ini_example.s
Text File  |  1999-11-30  |  21KB  |  625 lines

  1. *************************************************
  2. ***  Complex example program for INI library  ***
  3. ***          © 1999 by Basty/Seasons          ***
  4. ***   This program demonstrates the powerful  ***
  5. ***       functions of the INI library        ***
  6. ***             Assembler version             ***
  7. ***    Devpac 3.18 was used for development   ***
  8. *************************************************
  9.  
  10.     include    "exec/types.i"
  11.     include    "exec/libraries.i"
  12.     include    "exec/exec_lib.i"
  13.     include    "libraries/dosextens.i"
  14.     include    "libraries/ini_lib.i"
  15.     include    "intuition/screens.i"
  16.     include    "intuition/intuition.i"
  17.     include    "intuition/intuitionbase.i"
  18.     include    "intuition/intuition_lib.i"
  19.     include    "graphics/graphics_lib.i"
  20.     include    "graphics/rastport.i"
  21.  
  22.     moveq    #20,d7                    * Set FAIL error mark
  23.     moveq    #31,d0                    * Version 31.00 of ini.library
  24.     lea    ININame(pc),a1                * Load A1 with ini.library
  25.     move.l    4.w,a6
  26.  
  27.     jsr    _LVOOpenLibrary(a6)            * Open ini.library
  28.  
  29.     move.l    d0,_INIBase                * Store ini.library base to INIBase
  30.     beq    OpenINIError                * Exit if error
  31.  
  32.     moveq    #0,d0                    * Any version of intuition.library
  33.     lea    IntName(pc),a1                * Load A1 with intuition.library
  34.  
  35.     jsr    _LVOOpenLibrary(a6)            * Open intuition.library
  36.  
  37.     move.l    d0,_IntBase                * Store intuition.library base to IntBase
  38.  
  39.     moveq    #0,d0                    * Any version of graphics.library
  40.     lea    GfxName(pc),a1                * Load A1 with graphics.library
  41.  
  42.     jsr    _LVOOpenLibrary(a6)            * Open graphics.library
  43.  
  44.     move.l    d0,_GfxBase                * Store graphics.library base to GfxBase
  45.  
  46.     move.l    _IntBase(pc),a0            * Get first screen (WB screen)
  47.     move.l    ib_FirstScreen(a0),WBScreen+8
  48.  
  49.     lea    DefaultINI(pc),a0            * Load default INI file
  50.     lea    ExampleINI(pc),a1            * Open :Example.INI file
  51.     move.l    #DefaultLen,d0            * Length of it in D0
  52.  
  53.     CALLINIB    iniOpenDefault        * Open INI file/Create default INI file
  54.  
  55.     move.l    d0,DefINIFile            * Store loaded iniFile
  56.     beq    CloseINI                    * Error -> close everything and end
  57.  
  58.     moveq    #1,d6                    * Start with first screen
  59. LoopReadScr:    lea    ScreenNum(pc),a0    * Store to screen number
  60.     move.l    d6,d0                    * Current screen number
  61.     moveq    #INI_FORMAT_DEC,d1        * Use standard decimal format
  62.     moveq    #0,d2                    * No given length, as long as the string
  63.                                     * becomes.
  64.     moveq    #" ",d3                    * Use SPACE character as zero separator
  65.  
  66.     CALLINIB    iniIntToStr            * Convert screen number
  67.  
  68.     move.l    DefINIFile(pc),a0
  69.     lea    ScreenContext(pc),a1        * Find the context
  70.     moveq    #0,d0                    * No flags (case insensitive search)
  71.  
  72.     CALLINI    iniFindContext            * Search for context
  73.  
  74.     tst.l    d0                        * Found?
  75.     beq    LoopReadScrDone                * No -> end of search
  76.     move.l    d0,CurrentContext        * Store current ContextStr
  77.  
  78.     lea    NewScreenStr(pc),a5            * NewScreen structure to A5
  79.     move.l    DefINIFile(pc),a0
  80.     lea    ScreenContext(pc),a1        * Get current screen context name
  81.     lea    LeftEdgeName(pc),a2            * Get left edge value
  82.     moveq    #0,d0                    * Default left edge is 0
  83.     moveq    #0,d1                    * No flags (case insensitive search)
  84.  
  85.     CALLINI    iniReadLong
  86.  
  87.     move.w    d0,(a5)                    * Store left edge into screen structure
  88.  
  89.     move.l    DefINIFile(pc),a0
  90.     lea    ScreenContext(pc),a1        * Get current screen context name
  91.     lea    TopEdgeName(pc),a2            * Get top edge value
  92.     moveq    #0,d0                    * Default top edge is 0
  93.     moveq    #0,d1                    * No flags (case insensitive search)
  94.  
  95.     CALLINI    iniReadLong
  96.  
  97.     move.w    d0,ns_TopEdge(a5)        * Store top edge into screen structure
  98.  
  99.     move.l    DefINIFile(pc),a0
  100.     lea    ScreenContext(pc),a1        * Get current screen context name
  101.     lea    WidthName(pc),a2            * Get width value
  102.     move.l    #640,d0                    * Default width is 640
  103.     moveq    #0,d1                    * No flags (case insensitive search)
  104.  
  105.     CALLINI    iniReadLong
  106.  
  107.     move.w    d0,ns_Width(a5)            * Store width into screen structure
  108.  
  109.     move.l    DefINIFile(pc),a0
  110.     lea    ScreenContext(pc),a1        * Get current screen context name
  111.     lea    HeightName(pc),a2            * Get height value
  112.     move.l    #256,d0                    * Default height is 256
  113.     moveq    #0,d1                    * No flags (case insensitive search)
  114.  
  115.     CALLINI    iniReadLong
  116.  
  117.     move.w    d0,ns_Height(a5)        * Store height into screen structure
  118.  
  119.     move.l    DefINIFile(pc),a0
  120.     lea    ScreenContext(pc),a1        * Get current screen context name
  121.     lea    DepthName(pc),a2            * Get depth value
  122.     moveq    #4,d0                    * Default depth is 4
  123.     moveq    #0,d1                    * No flags (case insensitive search)
  124.  
  125.     CALLINI    iniReadLong
  126.  
  127.     move.w    d0,ns_Depth(a5)            * Store depth into screen structure
  128.  
  129.     move.l    DefINIFile(pc),a0
  130.     lea    ScreenContext(pc),a1        * Get current screen context name
  131.     lea    ViewModesName(pc),a2        * Get view mode value
  132.     move.l    #$8000,d0                * Default view modes are 0x8000
  133.     moveq    #0,d1                    * No flags (case insensitive search)
  134.  
  135.     CALLINI    iniReadLong
  136.  
  137.     move.w    d0,ns_ViewModes(a5)        * Store view mode into screen structure
  138.  
  139.     move.l    DefINIFile(pc),a0
  140.     lea    ScreenContext(pc),a1        * Get current screen context name
  141.     lea    TitleName(pc),a2            * Get screen title
  142.     lea    DefaultScrTitle(pc),a3        * Default screen title
  143.     moveq    #0,d0                    * No flags (case insensitive search)
  144.  
  145.     CALLINI    iniReadStr
  146.  
  147.     move.l    d0,ns_DefaultTitle(a5)    * Store title into screen structure
  148.  
  149.     moveq    #256/4-1,d0                * Copy all 256 default colors to
  150.     moveq    #0,d1                    * updated color table
  151.     lea    DefaultColTab(pc),a0
  152.     lea    ScrColorTable(pc),a1
  153. CopyDefColTabLoop:    move.l    (a0)+,(a1)+
  154.     move.l    (a0)+,(a1)+
  155.     dbra    d0,CopyDefColTabLoop
  156.  
  157.     move.w    ns_Depth(a5),d0            * Calculate number of colors
  158.     moveq    #1,d5                    * store 1 color
  159.     lsl.b    d0,d5                    * multiply with 2^depth
  160.     bne.s    NotGreater                * if lesser than 256 colors -> jump
  161.     move.w    #$100,d5                * set to 256 colors
  162. NotGreater:    move.l    DefINIFile(pc),a0
  163.     lea    ScreenContext(pc),a1        * Get current screen context name
  164.     lea    ColorTableName(pc),a2        * Get color table context item name
  165.     lea    ScrColorTable(pc),a3        * Get array pointer
  166.     move.l    d5,d0                    * Number of entries to read
  167.     moveq    #0,d1                    * No flags (case insensitive search)
  168.  
  169.     CALLINI    iniReadWordA            * Read color table array
  170.  
  171.     moveq    #24,d0                    * We need 24 bytes of storage buffer for
  172.                                     * each screen we open.
  173.     CALLINI    iniAllocPMem            * Allocate it using ini.library
  174.  
  175.     tst.l    d0                        * Test if error
  176.     bne.s    AllocScrOk                * No -> continue
  177.  
  178.     move.l    ns_DefaultTitle(a5),a0    * Deallocate title string (don't forget!)
  179.  
  180.     CALLINIB    iniFreeNameStr        * Deallocate name string
  181.     bra    CloseINI                    * Close INI file
  182.  
  183. AllocScrOk:    lea    Screens(pc),a0        * Add the structure to the screen list
  184.     move.l    d0,a1
  185.     move.l    4.w,a6
  186.  
  187.     jsr    _LVOAddTail(a6)                * Use exec AddTail() for this
  188.  
  189.     move.l    a5,a0                    * Now we want to open the screen
  190.     move.l    _IntBase(pc),a6            * We need intuition.library for this
  191.  
  192.     jsr    _LVOOpenScreen(a6)            * Open the screen
  193.  
  194.     move.l    Screens+MLH_TAILPRED(pc),a0    * Get last screen structure added
  195.     addq.l    #MLN_SIZE,a0
  196.     move.l    d0,(a0)+                * Store the screen for later reuse
  197.     move.l    a0,(a0)                    * Initialize node list of windows
  198.     move.l    a0,MLH_TAILPRED(a0)        * Currently there are none.
  199.     addq.l    #4,(a0)
  200.     tst.l    d0                        * Check if screen open error
  201.     bne.s    AllocScrOk2                * No -> continue
  202.  
  203.     move.l    ns_DefaultTitle(a5),a0    * Deallocate title string (don't forget!)
  204.  
  205.     CALLINIB    iniFreeNameStr        * Deallocate name string
  206.     bra    CloseINI
  207.  
  208. AllocScrOk2:    move.l    d0,a0
  209.     move.l    d5,d0                    * Read color map
  210.     lea    sc_ViewPort(a0),a0            * Screen->ViewPort
  211.     lea    ScrColorTable(pc),a1        * Load colors
  212.     move.l    _GfxBase(pc),a6            * We need graphics.library
  213.  
  214.     jsr    _LVOLoadRGB4(a6)            * Load color table
  215.  
  216.     addq.l    #1,d6                    * Increment screen counter
  217.     bra    LoopReadScr
  218.  
  219. LoopReadScrDone:    moveq    #1,d6    * Start with first window
  220. LoopReadWin:    lea    WindowNum(pc),a0    * Store to window number
  221.     move.l    d6,d0                    * Current window number
  222.     moveq    #INI_FORMAT_DEC,d1        * Use standard decimal format
  223.     moveq    #0,d2                    * No given length, as long as the string
  224.                                     * becomes.
  225.     moveq    #" ",d3                    * Use SPACE character as zero separator
  226.  
  227.     CALLINIB    iniIntToStr            * Convert window number
  228.  
  229.     addq.l    #1,d6                    * Next window
  230.     move.l    DefINIFile(pc),a0
  231.     lea    WindowContext(pc),a1        * Find the context
  232.     moveq    #0,d0                    * No flags (case insensitive search)
  233.  
  234.     CALLINI    iniFindContext            * Search for context
  235.  
  236.     tst.l    d0                        * Found?
  237.     beq    LoopReadWinDone                * No -> end of search
  238.     move.l    d0,CurrentContext        * Store current ContextStr
  239.  
  240.     lea    NewWindowStr(pc),a5            * NewWindow structure to A5
  241.  
  242.     move.l    DefINIFile(pc),a0
  243.     lea    WindowContext(pc),a1        * Get current window context name
  244.     lea    LeftEdgeName(pc),a2            * Get left edge value
  245.     moveq    #0,d0                    * Default left edge is 0
  246.     moveq    #0,d1                    * No flags (case insensitive search)
  247.  
  248.     CALLINI    iniReadLong
  249.  
  250.     move.w    d0,(a5)                    * Store left edge into window structure
  251.  
  252.     move.l    DefINIFile(pc),a0
  253.     lea    WindowContext(pc),a1        * Get current window context name
  254.     lea    TopEdgeName(pc),a2            * Get top edge value
  255.     moveq    #0,d0                    * Default top edge is 0
  256.     moveq    #0,d1                    * No flags (case insensitive search)
  257.  
  258.     CALLINI    iniReadLong
  259.  
  260.     move.w    d0,nw_TopEdge(a5)        * Store top edge into window structure
  261.  
  262.     move.l    DefINIFile(pc),a0
  263.     lea    WindowContext(pc),a1        * Get current window context name
  264.     lea    WidthName(pc),a2            * Get width value
  265.     move.l    #640,d0                    * Default width is 640
  266.     moveq    #0,d1                    * No flags (case insensitive search)
  267.  
  268.     CALLINI    iniReadLong
  269.  
  270.     move.w    d0,nw_Width(a5)            * Store width into window structure
  271.  
  272.     move.l    DefINIFile(pc),a0
  273.     lea    WindowContext(pc),a1        * Get current window context name
  274.     lea    HeightName(pc),a2            * Get height value
  275.     move.l    #256,d0                    * Default height is 256
  276.     moveq    #0,d1                    * No flags (case insensitive search)
  277.  
  278.     CALLINI    iniReadLong
  279.  
  280.     move.w    d0,nw_Height(a5)        * Store height into window structure
  281.  
  282.     move.l    DefINIFile(pc),a0
  283.     lea    WindowContext(pc),a1        * Get current window context name
  284.     lea    IDCMPName(pc),a2            * Get IDCMP value
  285.     move.l    #$20000,d0                * Default IDCMP flags are 0x00020000
  286.     moveq    #0,d1                    * No flags (case insensitive search)
  287.  
  288.     CALLINI    iniReadLong
  289.  
  290.     move.l    d0,nw_IDCMPFlags(a5)    * Store IDCMP into window structure
  291.  
  292.     move.l    DefINIFile(pc),a0
  293.     lea    WindowContext(pc),a1        * Get current window context name
  294.     lea    FlagsName(pc),a2            * Get flags value
  295.     move.l    #$100f,d0                * Default flags are 0x0000100F
  296.     moveq    #0,d1                    * No flags (case insensitive search)
  297.  
  298.     CALLINI    iniReadLong
  299.  
  300.     move.l    d0,nw_Flags(a5)            * Store flags into window structure
  301.  
  302.     move.l    DefINIFile(pc),a0
  303.     lea    WindowContext(pc),a1        * Get current window context name
  304.     lea    TitleName(pc),a2            * Get title name
  305.     lea    DefaultWinTitle(pc),a3        * Default window title
  306.     moveq    #0,d0                    * No flags (case insensitive search)
  307.  
  308.     CALLINI    iniReadStr
  309.  
  310.     move.l    d0,nw_Title(a5)            * Store title into window structure
  311.  
  312.     move.l    DefINIFile(pc),a0
  313.     lea    WindowContext(pc),a1        * Get current window context name
  314.     lea    MinWidthName(pc),a2            * Get minium width value
  315.     moveq    #32,d0                    * Default mininum width is 32
  316.     moveq    #0,d1                    * No flags (case insensitive search)
  317.  
  318.     CALLINI    iniReadLong
  319.  
  320.     move.w    d0,nw_MinWidth(a5)        * Store min width into window structure
  321.  
  322.     move.l    DefINIFile(pc),a0
  323.     lea    WindowContext(pc),a1        * Get current window context name
  324.     lea    MaxWidthName(pc),a2            * Get max width value
  325.     move.l    #640,d0                    * Default maximum width is 640
  326.     moveq    #0,d1                    * No flags (case insensitive search)
  327.  
  328.     CALLINI    iniReadLong
  329.  
  330.     move.w    d0,nw_MaxWidth(a5)        * Store max width into window structure
  331.  
  332.     move.l    DefINIFile(pc),a0
  333.     lea    WindowContext(pc),a1        * Get current window context name
  334.     lea    MinHeightName(pc),a2        * Get mininum height value
  335.     moveq    #32,d0                    * Default mininum height is 32
  336.     moveq    #0,d1                    * No flags (case insensitive search)
  337.  
  338.     CALLINI    iniReadLong
  339.  
  340.     move.w    d0,nw_MinHeight(a5)        * Store min height into window structure
  341.  
  342.     move.l    DefINIFile(pc),a0
  343.     lea    WindowContext(pc),a1        * Get current window context name
  344.     lea    MaxHeightName(pc),a2        * Get maximum height value
  345.     move.l    #256,d0                    * Default maximum height is 256
  346.     moveq    #0,d1                    * No flags (case insensitive search)
  347.  
  348.     CALLINI    iniReadLong
  349.  
  350.     move.w    d0,nw_MaxHeight(a5)        * Store max height into window structure
  351.  
  352.     move.l    DefINIFile(pc),a0
  353.     lea    WindowContext(pc),a1        * Get current window context name
  354.     lea    ScreenName(pc),a2            * Get screen number value
  355.     moveq    #1,d0                    * Default number is 1
  356.     moveq    #0,d1                    * No flags (case insensitive search)
  357.  
  358.     CALLINI    iniReadLong
  359.  
  360.     lea    Screens(pc),a0                * Find screen list
  361. FindScreenLoop:    move.l    (a0),a0        * Next screen
  362.     tst.l    (a0)                    * End of list?
  363.     beq    LoopReadWin                    * Yes -> next window
  364.     subq.l    #1,d0                    * Decrease counter
  365.     bcc.s    FindScreenLoop            * Not zero? -> continue
  366.     move.l    8(a0),nw_Screen(a5)        * Copy screen pointer
  367.     move.l    a0,a2
  368.     moveq    #12,d0                    * We need 12 bytes of storage buffer for
  369.                                     * each window we open.
  370.     CALLINI    iniAllocPMem            * Allocate it using ini.library
  371.  
  372.     tst.l    d0                        * Test if error
  373.     bne.s    AllocWinOk                * No -> continue
  374.  
  375.     move.l    nw_Title(a5),a0            * Deallocate title string (don't forget!)
  376.  
  377.     CALLINIB    iniFreeNameStr        * Deallocate name string
  378.     bra.s    CloseINI                * Close resources
  379.  
  380. AllocWinOk:    lea    12(a2),a0            * Add the structure to the window list
  381.     move.l    d0,a1
  382.     move.l    4.w,a6
  383.  
  384.     jsr    _LVOAddTail(a6)                * Use exec AddTail() for this
  385.  
  386.     move.l    a5,a0                    * Now we want to open the window
  387.     move.l    _IntBase(pc),a6            * We need intuition.library for this
  388.  
  389.     jsr    _LVOOpenWindow(a6)            * Open the window
  390.  
  391.     tst.l    d0                        * Check if window error
  392.     bne.s    AllocWinOk2                * No -> continue
  393.  
  394.     move.l    nw_Title(a5),a0            * Deallocate title string (don't forget!)
  395.  
  396.     CALLINIB    iniFreeNameStr        * Deallocate name string
  397.     bra.s    CloseINI                * Close resources
  398.  
  399. AllocWinOk2:    move.l    MLH_TAILPRED+12(a2),a0    * Get last window pointer
  400.     move.l    d0,8(a0)                * Store current window pointer
  401.  
  402.     bra    LoopReadWin                    * Read next window
  403.  
  404. LoopReadWinDone:    btst    #6,$bfe001    * Wait for mouse button
  405.     bne.s    LoopReadWinDone
  406.     moveq    #0,d7    * Set no error mark
  407. CloseINI:    lea    Screens(pc),a2        * We want to deallocate all screens
  408. ScreenCloseLoop:    move.l    (a2),a3    * Next screen
  409.     tst.l    (a3)                    * Have we reached last entry?
  410.     beq    ScreenCloseDone                * Yes -> done
  411.     lea    12(a3),a4                    * Get window pointers
  412.     move.l    (a4),d6
  413. WindowCloseLoop:    move.l    d6,a4    * Get next window pointer
  414.     tst.l    (a4)                    * Test if last.
  415.     beq.s    WindowCloseDone            * Yes -> done
  416.     move.l    8(a4),d0                * Get window to close
  417.     beq.s    SkipCloseWin            * No window opened -> skip
  418.     move.l    d0,a0
  419.     move.l    wd_Title(a0),d2            * Save window title
  420.     move.l    _IntBase(pc),a6            * intuition.library
  421.  
  422.     jsr    _LVOCloseWindow(a6)            * Close the damn window!
  423.  
  424.     move.l    d2,a0
  425.     CALLINIB    iniFreeNameStr        * Deallocate title name string
  426.  
  427. SkipCloseWin:    move.l    (a4),d6        * Get next window pointer
  428.     moveq    #12,d0                    * Deallocate 12 bytes
  429.     move.l    a4,a1                    * Deallocate window structure
  430.  
  431.     CALLINIB    iniFreePMem            * Deallocate memory using ini.library
  432.  
  433.     bra.s    WindowCloseLoop            * Free next window
  434. WindowCloseDone:    move.l    a3,a1    * Remove node entry before dealloc
  435.     move.l    4.w,a6                    * exec.library
  436.  
  437.     jsr    _LVORemove(a6)                * Remove it!
  438.  
  439.     move.l    8(a3),d0                * Get screen pointer
  440.     beq.s    NoScrPtr                * No -> skip
  441.     cmp.l    WBScreen+8(pc),d0        * Is WB screen?
  442.     beq.s    ScreenCloseLoop            * Don't close it!
  443.     move.l    d0,a0
  444.     move.l    sc_Title(a0),d2            * Save screen title string for dealloc
  445.  
  446.     move.l    _IntBase(pc),a6            * We need intuition.library
  447.  
  448.     jsr    _LVOCloseScreen(a6)            * Close the screen
  449.  
  450.     move.l    d2,a0                    * Deallocate title string (don't forget!)
  451.  
  452.     CALLINIB    iniFreeNameStr        * Deallocate name string
  453.  
  454. NoScrPtr:    moveq    #24,d0            * Deallocate screen storage buffer
  455.     move.l    a3,a1
  456.  
  457.     CALLINIB    iniFreePMem            * Use iniFreePMem() to deallocate
  458.  
  459.     bra    ScreenCloseLoop                * Deallocate next entry
  460. ScreenCloseDone:    move.l    DefINIFile(pc),a0
  461.  
  462.     CALLINIB    iniClose            * Close INI file and deallocate memory
  463.  
  464.     move.l    _GfxBase(pc),a1
  465.     move.l    4.w,a6
  466.  
  467.     jsr    _LVOCloseLibrary(a6)        * Close graphics.library
  468.  
  469.     move.l    _IntBase(pc),a1
  470.     move.l    4.w,a6
  471.  
  472.     jsr    _LVOCloseLibrary(a6)        * Close intuition.library
  473.  
  474.     move.l    _INIBase(pc),a1
  475.     move.l    4.w,a6
  476.  
  477.     jsr    _LVOCloseLibrary(a6)        * Close INI library
  478.  
  479. OpenINIError:    move.l    d7,d0        * Set return code
  480.     rts                                * Exit to DOS
  481.  
  482. _INIBase:    dc.l    0
  483. _IntBase:    dc.l    0
  484. _GfxBase:    dc.l    0
  485. DefINIFile:    dc.l    0
  486. CurrentContext:    dc.l    0
  487. ScrColorTable:    ds.w    256
  488. DefaultColTab:    dc.w    $000,$fff,$777,$ccc
  489.     dc.w    $444,$555,$666,$888
  490.     dc.w    $111,$222,$aaa,$333
  491.     dc.w    $999,$ddd,$eee,$bbb
  492.     ds.w    240
  493. Screens:    dc.l    WBScreen        * Initialize nodes automatically
  494.     dc.l    0
  495.     dc.l    WBScreen
  496. WBScreen:    dc.l    Screens+4
  497.     dc.l    Screens
  498.     dc.l    0
  499. WBScrWin:    dc.l    WBScrWin+4
  500.     dc.l    0
  501.     dc.l    WBScrWin
  502. NewScreenStr:    dc.w    0,0,640,256
  503.     dc.w    4
  504.     dc.b    1,0
  505.     dc.w    $8000
  506.     dc.w    CUSTOMSCREEN
  507.     dc.l    0
  508.     dc.l    0
  509.     dc.l    0
  510.     dc.l    0
  511. NewWindowStr:    dc.w    0,0,640,256
  512.     dc.b    1,0
  513.     dc.l    $200
  514.     dc.l    $100f
  515.     dc.l    0
  516.     dc.l    0
  517.     dc.l    0
  518.     dc.l    0
  519.     dc.l    0
  520.     dc.w    0,0,640,256
  521.     dc.w    CUSTOMSCREEN
  522. ININame:    ININAME
  523. IntName:    dc.b    'intuition.library',0
  524. GfxName:    dc.b    'graphics.library',0
  525. ExampleINI:    dc.b    ':Example.INI',0
  526. DefaultINI:    dc.b    "/* This is an example INI file of the ini.library which",10
  527.     dc.b    "   shows how the INI configuration files can be used. It supports",10
  528.     dc.b    "   multiple accesses. This file is always created if it can't be",10
  529.     dc.b    "   accessed for any reason (usually when it doesn't exists) */",10
  530.     dc.b    10
  531.     dc.b    '  [Screen1]           ; Up to 9 screens are allowed.',10
  532.     dc.b    '  LeftEdge = 0        ; Left edge of screen.',10
  533.     dc.b    '  TopEdge = 0         ; Top edge of screen.',10
  534.     dc.b    '  Width = 640         ; Width of screen.',10
  535.     dc.b    '  Height = 256        ; Height of screen.',10
  536.     dc.b    '  Depth = 4           ; Use 2^Depth colors.',10
  537.     dc.b    '  ViewMode = 0x8000   ; Screen view mode (lores, hires, etc.)',10
  538.     dc.b    '  Title = Example INI Test Screen © 1999 by Basty/Seasons  ; Default title',10
  539.     dc.b    '  ColorTable = 0x000, 0xFFF, 0x777, 0xCCC,  ; Color table entries.',10
  540.     dc.b    '               0x444, 0x555, 0x666, 0x888,  ; There are 2^Depth entries',10
  541.     dc.b    '               0x111, 0x222, 0xAAA, 0x333,  ; required. Further entries',10
  542.     dc.b    '               0x999, 0xDDD, 0xEEE, 0xBBB,  ; will be ignored.',10
  543.     dc.b    10
  544.     dc.b    '* Now we configure the windows to be opened. Please note that the windows',10
  545.     dc.b    "* are assigned using the 'Screen' context item.",10
  546.     dc.b    10
  547.     dc.b    '  [Window1]',10
  548.     dc.b    '  LeftEdge = 0        ; Left edge of window.',10
  549.     dc.b    '  TopEdge = 0         ; Top edge of window.',10
  550.     dc.b    '  Width = 640         ; Width of window.',10
  551.     dc.b    '  Height = 256         ; Height of window.',10
  552.     dc.b    '  IDCMP = 0x00020000  ; IDCMP flags of window.',10
  553.     dc.b    '  Flags = 0x0000100F  ; Default window flags.',10
  554.     dc.b    '  Title = Example INI Test Window © 1999 by Basty/Seasons  ; Default title',10
  555.     dc.b    '  Screen = 1          ; Screen to open window on. 0 is workbench screen',10
  556.     dc.b    '  MinWidth = 32',10
  557.     dc.b    '  MinHeight = 32',10
  558.     dc.b    '  MaxWidth = 640',10
  559.     dc.b    '  MaxHeight = 256',10
  560.     dc.b    10
  561.     dc.b    '  [Window2]',10
  562.     dc.b    '  LeftEdge = 0        ; Left edge of window.',10
  563.     dc.b    '  TopEdge = 16        ; Top edge of window.',10
  564.     dc.b    '  Width = 640         ; Width of window.',10
  565.     dc.b    '  Height = 64         ; Height of window.',10
  566.     dc.b    '  IDCMP = 0x00020000  ; IDCMP flags of window.',10
  567.     dc.b    '  Flags = 0x0000100F  ; Default window flags.',10
  568.     dc.b    '  Title = Small window #2  ; Default title',10
  569.     dc.b    '  Screen = 1          ; Screen to open window on. 0 is workbench screen',10
  570.     dc.b    '  MinWidth = 32',10
  571.     dc.b    '  MinHeight = 32',10
  572.     dc.b    '  MaxWidth = 640',10
  573.     dc.b    '  MaxHeight = 64',10
  574.     dc.b    10
  575.     dc.b    '  [Window3]',10
  576.     dc.b    '  LeftEdge = 0        ; Left edge of window.',10
  577.     dc.b    '  TopEdge = 80        ; Top edge of window.',10
  578.     dc.b    '  Width = 640         ; Width of window.',10
  579.     dc.b    '  Height = 64         ; Height of window.',10
  580.     dc.b    '  IDCMP = 0x00020000  ; IDCMP flags of window.',10
  581.     dc.b    '  Flags = 0x0000100F  ; Default window flags.',10
  582.     dc.b    '  Title = Small window #3  ; Default title',10
  583.     dc.b    '  Screen = 1          ; Screen to open window on. 0 is workbench screen',10
  584.     dc.b    '  MinWidth = 32',10
  585.     dc.b    '  MinHeight = 32',10
  586.     dc.b    '  MaxWidth = 640',10
  587.     dc.b    '  MaxHeight = 64',10
  588.     dc.b    10
  589.     dc.b    '  [Window4]',10
  590.     dc.b    '  LeftEdge = 0        ; Left edge of window.',10
  591.     dc.b    '  TopEdge = 144       ; Top edge of window.',10
  592.     dc.b    '  Width = 640         ; Width of window.',10
  593.     dc.b    '  Height = 64         ; Height of window.',10
  594.     dc.b    '  IDCMP = 0x00020000  ; IDCMP flags of window.',10
  595.     dc.b    '  Flags = 0x0000100F  ; Default window flags.',10
  596.     dc.b    '  Title = Small window #4  ; Default title',10
  597.     dc.b    '  Screen = 1          ; Screen to open window on. 0 is workbench screen',10
  598.     dc.b    '  MinWidth = 32',10
  599.     dc.b    '  MinHeight = 32',10
  600.     dc.b    '  MaxWidth = 640',10
  601.     dc.b    '  MaxHeight = 64',10
  602.     dc.b    10
  603. DefaultLen:    equ    *-DefaultINI
  604. ScreenContext:    dc.b    'Screen'
  605. ScreenNum:    ds.b    10
  606. WindowContext:    dc.b    'Window'
  607. WindowNum:    ds.b    10
  608. LeftEdgeName:    dc.b    'LeftEdge',0
  609. TopEdgeName:    dc.b    'TopEdge',0
  610. WidthName:    dc.b    'Width',0
  611. HeightName:    dc.b    'Height',0
  612. DepthName:    dc.b    'Depth',0
  613. ViewModesName:    dc.b    'ViewMode',0
  614. TitleName:    dc.b    'Title',0
  615. ColorTableName:    dc.b    'ColorTable',0
  616. IDCMPName:    dc.b    'IDCMP',0
  617. FlagsName:    dc.b    'Flags',0
  618. ScreenName:    dc.b    'Screen',0
  619. MinWidthName:    dc.b    'MinWidth',0
  620. MinHeightName:    dc.b    'MinHeight',0
  621. MaxWidthName:    dc.b    'MaxWidth',0
  622. MaxHeightName:    dc.b    'MaxHeight',0
  623. DefaultScrTitle:    dc.b    'Example INI Test Screen © 1999 by Basty/Seasons',0
  624. DefaultWinTitle:    dc.b    'Example INI Test Window © 1999 by Basty/Seasons',0
  625.